1. Field of the Invention
The present invention pertains to image processing systems. More particularly, this invention relates to an image processing system with (1) skew correction that does not require human intervention or the presence of text or skew detection information on the original document, and (2) image cropping that is done regardless of the shape of the image.
2. Description of the Related Art
It has been known that when a document (i.e., the original physical object, such as photo or text document) is scanned by a scanner, a digital image of the original document is typically generated. The digital image of the original document is, however, often found to be skewed (rotated) inside the entire scan image (i.e., inside the entire digital image obtained from the scanner). As is known, the scan image typically includes the image of the document as well as background information. A skew or inclination of the document image within the scan image is particularly likely to occur when the scanner uses an automatic document feed mechanism to feed the original document for scanning. In addition, when the size of the original document is relatively small in comparison to the scan region of the scanner, the scan image may contain considerable amount of background information. FIG. 1 illustrates a scan image 10 which exhibits these problems.
As can be seen from FIG. 1, the scan image 10 contains a document image 11 of an original document. The remaining area of the scan image 10 is background 12 which typically has a predetermined pixel pattern. The document image 11 is skewed inside the scan image 10 and the background 12 is a considerable fraction of the scan image 10. When the scan image 10 is displayed on a display or printed by a printer, the document image 11 typically has a relatively unpleasant and poor visual quality. In addition, the skewed image may also cause errors when the image data is further processed by other software programs.
Prior techniques have been developed to try to detect and correct the skew problem. For example, U.S. Pat. No. 4,941,189, entitled OPTICAL CHARACTER READER WITH SKEW RECOGNITION and issued on Jul. 10,1990, describes a prior art skew correction technique that searches for text characters along a scan line. As another example, U.S. Pat. No. 5,452,374, entitled SKEW DETECTION AND CORRECTION OF A DOCUMENT IMAGE REPRESENTATION and as issued on Sep. 19, 1995, describes another prior technique that segments the scan image into text and non-text regions and then determines the skew information based on the resulting segmentation.
These prior techniques, however, require the original document to contain at least some text. The prior techniques then rely on the detection of one or more lines of the text in the document. With the advent of inexpensive photo scanners and multimedia personal computers, scanners are nowadays used to scan not only text documents, but photographs and other image documents as well. The photographs, however, typically do not contain any text data. This thus causes the prior skew detection and correction techniques to be inapplicable to the scanned photo images. In addition, because photographs can have a variety of sizes and shapes, it is typically difficult to trim the background information from the scanned image of a photograph.
Several prior art techniques have been proposed that detect the skew information of a scanned image without requiring the presence of text in the scanned document. One such prior art technique is described in U.S. Pat. No. 5,093,653, entitled IMAGE PROCESSING SYSTEM HAVING SKEW CORRECTION MEANS, and issued on Mar. 3, 1992. Another such prior art technique is described in U.S. Pat. No. 4,533,959, entitled PICTURE PROCESSING APPARATUS, and issued on Aug. 6, 1985. However, these prior art techniques require either human intervention (e.g., U.S. Pat. No. 5,093,653) or special skew detection marks on the original document (e.g., U.S. Pat. No. 4,533,959).